package xy.donate.android.db;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import java.util.List;
import xy.donate.android.entity.OrderBean;

@Dao
public interface OrderDao {

    //插入
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void insert(OrderBean bean);

    //查询所有
    @Query("select * from OrderBean where UserID = :userID")
    List<OrderBean> getAll(String userID);

    //查询对应状态
    @Query("select * from OrderBean where UserID = :userID and orderStatus = :orderStatus")
    List<OrderBean> getList(String userID,int orderStatus);

    //订单详情
    @Query("select * from OrderBean where OrderNo= :orderNO")
    OrderBean getOrderDetail(String orderNO);
}
